<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class MessagePost extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }
    
    /**
     * 验证规则
     *
     * @return array
     */
    public function rules()
    {
        return [
            'phone' => 'required',
            'accesstoken' => 'required',
            'title' => 'required',
        ];
    }
    
    /**
     * 提示消息处理
     *
     * @return array
     */
    public function messages()
    {
        return [
            'phone.required' => '账号不能为空',
            'accesstoken.required' => '操作令牌不能为空',
            'title.required' => '留言内容不能为空',
        ];
    }
}